<!DOCTYPE html>
<html lang="en">
<head>
    <!-- Required meta tags -->
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
    <title>ChatSDK</title>
    <style>
        body,
        html {
            height: 100%;
            margin: 0;
            padding: 0;
            overflow: hidden;
        }
        .button-dropdown {
            font-size: 12px;
        }
        .last-update {
            font-size: 10px;
        }
        iframe {
            border: none;
        }
    </style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light sticky-top">
    <a class="navbar-brand" href="#">ChatSDK</a>
    <div class="collapse navbar-collapse" id="navbarText">
        <ul class="navbar-nav mr-auto">
            <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle button-dropdown" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    Versions
                </a>
                <div class="dropdown-menu">
                    <a class="dropdown-item" href="ChatSDK/5.0.6/documentation/chatsdk" target="javadoc-viewer">5.0.6 (latest)</a>
                    <a class="dropdown-item" href="ChatSDK/5.0.5/documentation/chatsdk" target="javadoc-viewer">5.0.5</a>
                    <a class="dropdown-item" href="ChatSDK/5.0.4/documentation/chatsdk" target="javadoc-viewer">5.0.4</a>
                    <a class="dropdown-item" href="ChatSDK/5.0.3/documentation/chatsdk" target="javadoc-viewer">5.0.3</a>
                    <a class="dropdown-item" href="ChatSDK/5.0.2/documentation/chatsdk" target="javadoc-viewer">5.0.2</a>
                    <a class="dropdown-item" href="ChatSDK/5.0.1/documentation/chatsdk" target="javadoc-viewer">5.0.1</a>
                    <a class="dropdown-item" href="ChatSDK/5.0.0/documentation/chatsdk" target="javadoc-viewer">5.0.0</a>
                    <a class="dropdown-item" href="ChatSDK/4.0.1/documentation/chatsdk" target="javadoc-viewer">4.0.1</a>
                    <a class="dropdown-item" href="ChatSDK/4.0.0/documentation/chatsdk" target="javadoc-viewer">4.0.0</a>
                </div>
            </li>
        </ul>
        <span class="navbar-text last-update">Last update 10:37, 05-06-2025</span>
    </div>
</nav>
<iframe style="width: 100vw; height: 100vh; position: relative; padding-bottom: 56px;" id="javadoc-viewer" name="javadoc-viewer" src="about:blank" allowfullscreen></iframe>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script>
    const getUrlParameter = function getUrlParameter(sParam) {
        let sPageURL = decodeURIComponent(window.location.search.substring(1)),
            sURLVariables = sPageURL.split("&"),
            sParameterName,
            i;

        for (i = 0; i < sURLVariables.length; i++) {
            sParameterName = sURLVariables[i].split("=");
            if (sParameterName[0] === sParam) {
                return sParameterName[1] === undefined ? true : sParameterName[1];
            }
        }
    };

    const openInIframe = function openInIframe(url, clazz, hash) {
        if (clazz) {
            $("#javadoc-viewer").on("load", function () {
                const frame = $(this).contents().find("iframe[name='classFrame']");
                frame.attr("src", clazz);

                if (hash) {
                    frame.on("load", function () {
                        const contentDocument = frame[0].contentDocument || frame[0].contentWindow.document;
                        const offset = contentDocument.getElementById(hash.substring(1)).offsetTop;
                        $(this).contents().scrollTop(offset);
                        frame.unbind("load");
                    });
                }

                $("#javadoc-viewer").unbind("load");
            });
        }
        $("#javadoc-viewer").attr("src", url);
    };

    $(document).ready(function () {
        // Check if we have to deep-link
        const module = getUrlParameter("m");
        const tag = getUrlParameter("t");
        const diff = getUrlParameter("d");
        const clazz = getUrlParameter("c");
        const hash = window.location.hash;

        if (module) {
            let url = module + "/";
            if (tag) {
                url += tag + "/index.html";
            } else if (diff) {
                url += diff + "/changes.html";
            } else {
                url = $("#dropdown-" + module).find(".dropdown-item")[0].href;
            }
            openInIframe(url, clazz, hash);
        } else {
            openInIframe($(".dropdown-item")[0].href);
        }
    });
</script>
</body>
</html>
